package com.kgis.kp.model;

import java.util.Date;

/**
 * 
 * @author zhxiaomiao
 * 
 */
public abstract class LifecycleModel implements Model {

	/**
	 *
	 */
	private static final long serialVersionUID = 1274470102781713532L;
	protected long id = RAW_ID;

	/** create date */
	protected Date createDate;

	/** creator */
	protected String creator;

	/** update date */
	protected Date updateDate;

	/** updater */
	protected String updater;

	/**
	 * @return Returns the createDate.
	 */
	public Date getCreateDate() {
		return createDate;
	}

	/**
	 * @param createDate
	 *            The createDate to set.
	 */
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	/**
	 * @return Returns the creator.
	 */
	public String getCreator() {
		return creator;
	}

	/**
	 * @param creator
	 *            The creator to set.
	 */
	public void setCreator(String creator) {
		this.creator = creator;
	}

	/**
	 * @return the updater
	 */
	public String getUpdater() {
		return updater;
	}

	/**
	 * @param updater
	 *            the updater to set
	 */
	public void setUpdater(String updater) {
		this.updater = updater;
	}

	/**
	 * @return the updateDate
	 */
	public Date getUpdateDate() {
		return updateDate;
	}

	/**
	 * @param updateDate
	 *            the updateDate to set
	 */
	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}
	
	public boolean beNew() {
		return this.id <= 0;
	}
}
